home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / tkern10.zip / GNUISH\PWD.H < prev    next >
C/C++ Source or Header  |  1990-09-23  |  2KB  |  74 lines

  1. /*  pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS.
  2.     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  3.  
  4.     This program is free software; you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation; either version 1, or (at your option)
  7.     any later version.
  8.  
  9.     This program is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.     GNU General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU General Public License
  15.     along with this program; if not, write to the Free Software
  16.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.     $Header: e:/gnu/lib/RCS/pwd.h 1.1 90/09/23 11:21:12 tho Exp $
  19. */
  20.  
  21. /* This 'implementation' is conjectured from the use of this functions in
  22.    the RCS and BASH distributions.  Of course these functions don't do too
  23.    much useful things under MS-DOS, but using them avoids many "#ifdef
  24.    MSDOS" in ported UN*X code ...  */
  25.  
  26.  
  27. struct passwd
  28. {
  29.   /*    ...        */
  30.   /*    missing stuff    */
  31.   /*    ...        */
  32.   char *pw_name;        /* login user id        */
  33.   char *pw_dir;            /* home directory        */
  34.   char *pw_shell;        /* login shell            */
  35.   int  pw_uid;
  36. };
  37.  
  38. struct group
  39. {
  40.   /*    ...        */
  41.   /*    missing stuff    */
  42.   /*    ...        */
  43.   char *gr_name;        /* login user id        */
  44.   int  gr_gid;
  45. };
  46.  
  47. extern struct passwd *getpwuid (int);
  48. extern struct passwd *getpwnam (char *);
  49. extern struct group *getgrgid (int);
  50. extern struct group *getgrnam (char *);
  51. extern char *getlogin (void);
  52. extern char *getgr_name (void);
  53. extern int getuid (void);
  54. extern int getgid (void);
  55. extern int geteuid (void);
  56. extern int getegid (void);
  57.  
  58. extern int *groups;
  59. extern int ngroups;
  60. extern int getgroups (int, int *);
  61.  
  62. extern struct passwd *getpwent (void);
  63. extern void setpwent (void);
  64. extern void endpwent (void);
  65. extern void endgrent (void);
  66.  
  67. /*
  68.  * Local Variables:
  69.  * mode:C
  70.  * ChangeLog:ChangeLog
  71.  * compile-command:make
  72.  * End:
  73.  */
  74.